<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2016-2018 Steinar Bang                                                -->
<!--                                                                                 -->
<!-- Licensed under the Apache License, Version 2.0 (the "License");                 -->
<!-- you may not use this file except in compliance with the License.                -->
<!-- You may obtain a copy of the License at                                         -->
<!--   http://www.apache.org/licenses/LICENSE-2.0                                    -->
<!-- Unless required by applicable law or agreed to in writing,                      -->
<!-- software distributed under the License is distributed on an "AS IS" BASIS,      -->
<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.        -->
<!-- See the License for the specific language governing permissions and limitations -->
<!-- under the License.                                                              -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xml:space="preserve">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <artifactId>parent</artifactId>
        <groupId>no.priv.bang.ukelonn</groupId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>

    <artifactId>ukelonn.bundle</artifactId>
    <packaging>bundle</packaging>

    <name>Ukelonn webapp OSGi bundle</name>

    <properties>
        <Bundle-SymbolicName>no.priv.bang.ukelonn</Bundle-SymbolicName>
        <karaf-feature-name>ukelonn</karaf-feature-name>
    </properties>

    <dependencies>
        <dependency>
            <groupId>no.priv.bang.ukelonn</groupId>
            <artifactId>ukelonn.api</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>no.priv.bang.ukelonn</groupId>
            <artifactId>ukelonn.api</artifactId>
            <version>${project.version}</version>
            <type>xml</type>
            <classifier>features</classifier>
        </dependency>
        <dependency>
            <groupId>no.priv.bang.ukelonn</groupId>
            <artifactId>ukelonn.bundle.db.liquibase</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>no.priv.bang.ukelonn</groupId>
            <artifactId>ukelonn.bundle.db.test</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.component.annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.log</artifactId>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.web</groupId>
            <artifactId>pax-web-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.web</groupId>
            <artifactId>pax-web-runtime</artifactId>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.web</groupId>
            <artifactId>pax-web-extender-whiteboard</artifactId>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc-derby</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.liquibase</groupId>
            <artifactId>liquibase-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.derby</groupId>
            <artifactId>derby</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf.shell</groupId>
            <artifactId>org.apache.karaf.shell.console</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.shiro</groupId>
            <artifactId>shiro-core</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.shiro</groupId>
            <artifactId>shiro-web</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-server</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-themes</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-client-compiled</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-server</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin.addon</groupId>
            <artifactId>vaadin-touchkit-agpl</artifactId>
        </dependency>
    </dependencies>

    <build>
        <testResources>
            <testResource>
                <directory>src/main/webapp/WEB-INF</directory>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <supportedProjectTypes>
                        <supportedProjectType>jar</supportedProjectType>
                        <supportedProjectType>bundle</supportedProjectType>
                        <supportedProjectType>war</supportedProjectType>
                    </supportedProjectTypes>
                    <instructions>
                        <Bundle-SymbolicName>${Bundle-SymbolicName}</Bundle-SymbolicName>
                        <Bundle-Version>${project.version}</Bundle-Version>
                        <Karaf-Commands>*</Karaf-Commands>
                        <Import-Package>
                            no.priv.bang.ukelonn,
                            javax.servlet.http;version="[2.6.0,4.0.0)",
                            com.vaadin.shared,
                            com.vaadin.server,
                            com.vaadin.addon.touchkit.server,
                            com.vaadin.addon.touchkit.settings,
                            com.vaadin.addon.touchkit.annotations,
                            VAADIN.widgetsets.com.vaadin.addon.touchkit.gwt.TouchKitWidgetSet,
                            VAADIN.widgetsets.com.vaadin.addon.touchkit.gwt.TouchKitWidgetSet.deferredjs.0A32B241463C3CF770B8CD52599C1C21,
                            com.vaadin.addon.touchkit.extensions,
                            com.vaadin.addon.touchkit.gwt,
                            com.vaadin.addon.touchkit.gwt.client,
                            com.vaadin.addon.touchkit.gwt.client.communication,
                            com.vaadin.addon.touchkit.gwt.client.offlinemode,
                            com.vaadin.addon.touchkit.gwt.client.theme,
                            com.vaadin.addon.touchkit.gwt.client.theme.fonts,
                            com.vaadin.addon.touchkit.gwt.client.theme.img,
                            com.vaadin.addon.touchkit.gwt.client.ui,
                            com.vaadin.addon.touchkit.gwt.client.vcom,
                            com.vaadin.addon.touchkit.gwt.client.vcom.navigation,
                            com.vaadin.addon.touchkit.gwt.client.vcom.popover,
                            com.vaadin.addon.touchkit.service,
                            com.vaadin.addon.touchkit.ui,
                            assets,
                            VAADIN.themes,
                            VAADIN.widgetsets,
                            *
                        </Import-Package>
                        <Export-Package>!*</Export-Package>
                        <_removeheaders>
                            Include-Resource,
                            Private-Package,
                            Embed-Dependency,
                            Embed-Transitive
                        </_removeheaders>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>karaf-maven-plugin</artifactId>
                <configuration>
                    <primaryFeatureName>${karaf-feature-name}</primaryFeatureName>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.github.cjnygard</groupId>
                <artifactId>rest-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>update-bundle</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>rest-request</goal>
                        </goals>
                        <configuration>
                            <resource>system/console/bundles/${Bundle-SymbolicName}</resource>
                            <method>POST</method>
                            <fileset>
                                <directory>${project.build.directory}</directory>
                                <includes>
                                    <include>karaf-console-rest-post-update-arguments</include>
                                </includes>
                            </fileset>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
